<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace App\Box\Request;

use Mine\MineFormRequest;

/**
 * 盒子列表验证数据类
 */
class BoxInfoRequest extends MineFormRequest
{
    /**
     * 公共规则
     */
    public function commonRules(): array
    {
        return [];
    }

    
    /**
     * 新增数据验证规则
     * return array
     */
    public function saveRules(): array
    {
        return [
            //盒子名称 验证
            'name' => 'required',
            //盒子价格 验证
            'price' => 'required',
            //排序 验证
            'sort' => 'required',
            //是否展示的箱子(1展示，2:隐藏） 验证
            'status' => 'required',

        ];
    }
    /**
     * 更新数据验证规则
     * return array
     */
    public function updateRules(): array
    {
        return [
            //盒子名称 验证
            'name' => 'required',
            //盒子价格 验证
            'price' => 'required',
            //排序 验证
            'sort' => 'required',
            //是否展示的箱子(1展示，2:隐藏） 验证
            'status' => 'required',

        ];
    }

    
    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => 'ID',
            'category_id' => '盒子分类id',
            'name' => '盒子名称',
            'price' => '盒子价格',
            'sort' => '排序',
            'status' => '是否展示的箱子(1展示，2:隐藏）',
            'created_by' => '创建者',

        ];
    }

}